package aiku.numericalcontroloa.project.system.mapper;

import aiku.numericalcontroloa.project.system.pojo.entity.SysRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @ClassName aiku.numericalcontroloa.project.system.mapper
* @Description
* @Author Hardy
* @Time 2024/01/27 10:57
*/
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRole> {
    int deleteByPrimaryKey(@Param("rid") Integer rid);

    int insert(SysRole record);

    SysRole selectByPrimaryKey(Integer id);

    int updateByPrimaryKey(SysRole record);

    List<SysRole> listByUserId(@Param("uid") String uid);

    //查找所有角色
    List<SysRole> list();

    int updateRoleStatus(SysRole role);

    int insertRoleMenu(SysRole record);

    List<SysRole> ListByEnabled();

    List<String> listRolePerms(@Param("rid") String rid);

    int deleteRolePerms(String rid);

    int handleRolePerms(@Param("rid") String rid, @Param("menusId") List<Integer> menusId);
}